CREATE TABLE [dbo].[tb_ErroresLiquidacion]
(
[idError] [int] NOT NULL IDENTITY(1, 1),
[Liquidacion] [int] NULL,
[Agente] [int] NULL,
[Organizacion] [int] NULL,
[Servicio] [int] NULL,
[Concepto] [int] NULL,
[Fecha] [datetime] NOT NULL,
[Diagnostico] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CabeceraDeLiquidacion] [int] NULL,
[NumeroDeError] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_ErroresLiquidacion] ADD CONSTRAINT [PK_tb_ErroresLiquidacion] PRIMARY KEY NONCLUSTERED  ([idError]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_ErroresLiquidacion] WITH NOCHECK ADD CONSTRAINT [FK_tb_ErroresLiquidacion_tb_Agentes] FOREIGN KEY ([Agente]) REFERENCES [dbo].[tb_Agentes] ([idAgente])
GO
ALTER TABLE [dbo].[tb_ErroresLiquidacion] WITH NOCHECK ADD CONSTRAINT [FK_tb_ErroresLiquidacion_tb_CabeceraDeLiquidacion] FOREIGN KEY ([CabeceraDeLiquidacion]) REFERENCES [dbo].[tb_CabeceraDeLiquidacion] ([IdCabeceraDeLiquidacion])
GO
ALTER TABLE [dbo].[tb_ErroresLiquidacion] WITH NOCHECK ADD CONSTRAINT [FK_tb_ErroresLiquidacion_tb_ConceptosDeLiquidacion] FOREIGN KEY ([Concepto]) REFERENCES [dbo].[tb_ConceptosDeLiquidacion] ([idConceptoLiquidacion])
GO
ALTER TABLE [dbo].[tb_ErroresLiquidacion] WITH NOCHECK ADD CONSTRAINT [FK_tb_ErroresLiquidacion_tb_Liquidaciones] FOREIGN KEY ([Liquidacion]) REFERENCES [dbo].[tb_Liquidaciones] ([idLiquidacion])
GO
ALTER TABLE [dbo].[tb_ErroresLiquidacion] WITH NOCHECK ADD CONSTRAINT [FK_tb_ErroresLiquidacion_tb_Organizaciones] FOREIGN KEY ([Organizacion]) REFERENCES [dbo].[tb_Organizaciones] ([idOrganizaciones])
GO
